package com.tamecode.chapter07.sec3.advice.spring;

import com.tamecode.chapter07.sec3.advice.before.Waiter;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author: Qiongchao
 * @Version: 1.0.0
 * @Date: 2023/11/19
 */
public class AdviceTest {
    public static void main(String[] args) {
        String configPath = "beans/sec3/spring-beans.xml";
        ApplicationContext ctx = new ClassPathXmlApplicationContext(configPath);
        Waiter waiter = (Waiter)ctx.getBean("waiter");
        System.out.println(waiter.getClass());
        waiter.greetTo("John");
        /*
        How are you！Mr.John.
        greet to John...
        */
    }
}
